GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( ba10d9...348b84 )
by Sebastian
03:16
created

ReCaptchaField.js ➔ ... ➔ poll   A

Complexity

Conditions 1
Paths 2

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
nc 2
nop 0
dl 0
loc 10
rs 10
c 1
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A ReCaptchaField.js ➔ reCaptchaOnSubmit 0 4 1
1
'use strict';
2
3
function reCaptchaInit() {
4
    var element = document.createElement('script'),
5
        target = document.querySelectorAll('script')[0],
6
        protocol = 'https:' == document.location.protocol ? 'https' : 'http';
7
    element.type = 'text/javascript';
8
    element.src = protocol + '://www.google.com/recaptcha/api.js?onload=reCaptchaOnloadCallback&render=explicit&hl='.concat(window.SS_LOCALE);
9
    target.parentNode.insertBefore(element, target);
10
}
11
12
function reCaptchaOnloadCallback() {
13
    var reCaptcha = document.querySelector('.g-recaptcha');
14
15
    if (reCaptcha.dataset.size === 'invisible') {
16
        document.querySelector('#'.concat(window.ReCaptchaFormId)).addEventListener('submit', reCaptchaFormOnSubmit);
17
    }
18
19
    grecaptcha.render(reCaptcha, reCaptcha.dataset);
0 ignored issues
show
Bug introduced by
The variable grecaptcha seems to be never declared. If this is a global, consider adding a /** global: grecaptcha */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
20
}
21
22
function reCaptchaOnSubmit(token) {
23
    document.querySelector('#'.concat(window.ReCaptchaFormId, ' .g-recaptcha-response')).value = token;
24
    document.querySelector('#'.concat(window.ReCaptchaFormId)).submit();
25
}
26
27
function reCaptchaFormOnSubmit(event) {
28
    event.preventDefault();
29
    grecaptcha.execute();
0 ignored issues
show
Bug introduced by
The variable grecaptcha seems to be never declared. If this is a global, consider adding a /** global: grecaptcha */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
30
}
31
32
domReady(reCaptchaInit);
33